<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/include/page.jsp"%>
<jsp:useBean class="com.wang.users.pojo.ABodyside" id="sidePojo"/>
<!DOCTYPE HTML>
<html>
	<head>
		<%@ include file="/common/include/title.jsp"%>
		<title>体侧历史添加 - 体能测试系统</title>
	</head>
	<body>
		<nav class="breadcrumb">
			<i class="Hui-iconfont">&#xe67f;</i> 首页 
			<span class="c-gray en">&gt;</span> 体侧管理 
			<span class="c-gray en">&gt;</span> 添加体侧历史
			<a class="btn btn-success radius r"
				style="line-height: 1.6em; margin-top: 3px"
				href="javascript:location.replace(location.href);" title="刷新">
				<i class="Hui-iconfont">&#xe68f;</i>
			</a>
		</nav>
		<article class="page-container">
			<form class="form form-horizontal" id="formSubmit" action="${rootPath }/back/side/sidesInsertSubmit" method="post">
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2"><span
						class="c-red">*</span>用户邮箱：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" class="input-text" value="${sidePojo.users.email}" placeholder="请输入用户邮箱"
							id="email" name="email">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2"><span
						class="c-red">*</span>肺活量：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" class="input-text" value="${sidePojo.vitalcapacity}" placeholder="请输入肺活量"
							id="vitalcapacity" name="vitalcapacity">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2"><span
						class="c-red">*</span>1000米跑/800米跑</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" class="input-text" value="${sidePojo.longrun}" placeholder="请输入1000米跑/800米跑"
							id="longrun" name="longrun">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2"><span
						class="c-red">*</span>50米跑:秒</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" class="input-text" value="${sidePojo.shortrun}" placeholder="请输入50米跑:秒"
							id="shortrun" name="shortrun">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2"><span
						class="c-red">*</span>身高:米</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" class="input-text" value="${sidePojo.height}" placeholder="请输入身高:米"
							id="height" name="height">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2"><span
						class="c-red">*</span>体重:KG</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" class="input-text" value="${sidePojo.weight}" placeholder="请输入体重:KG"
							id="weight" name="weight">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2"><span
						class="c-red">*</span>体脂: %</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" class="input-text" value="${sidePojo.bml}" placeholder="请输入体脂: %"
							id="bml" name="bml">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2"><span
						class="c-red">*</span>仰卧起坐/引体向上:个</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" class="input-text" value="${sidePojo.abdominalcurl}" placeholder="请输入仰卧起坐/引体向上:个"
							id="abdominalcurl" name="abdominalcurl">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2"><span
						class="c-red">*</span>坐位体前屈:厘米</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" class="input-text" value="${sidePojo.sittingforward}" placeholder="请输入坐位体前屈:厘米"
							id="sittingforward" name="sittingforward">
					</div>
				</div>

				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2">状态：</label>
					<div class="formControls col-xs-8 col-sm-9 skin-minimal">
						<c:forEach items="${sidePojo.enumsMap }" var="me" varStatus="stat">
							<c:if test="${fn:startsWith(me.key,'STATUS')}">
								<!-- 拆分,按照-拆分,取最后一个 -->
								<c:set value="${fn:split(me.key, '-')}" var="keys"/>
								<div class="radio-box">
									<label for="${me.key }">
										<input type="radio" id="${me.key }" name="status" value="${keys[1] }" ${pojo.status == keys[1] ? 'checked' : '' }>
										&nbsp;${me.value }
									</label>
								</div>
							</c:if>
						</c:forEach>
					</div>
				</div>
				<div class="row cl">
					<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
						<button 
							class="btn btn-primary radius" type="submit">
							<i class="Hui-iconfont">&#xe632;</i> 提交
						</button>
					</div>
				</div>
			</form>
		</article>
		<%@ include file="/common/include/footer.jsp" %>
		<script type="text/javascript" >
			$(function(){
				$('.skin-minimal input').iCheck({
					checkboxClass: 'icheckbox-blue',
					radioClass: 'iradio-blue',
					increaseArea: '20%'
				});
				
				//表单验证
				$("#formSubmit").validate({
					rules:{
						email : {
							required : true,
							email:true,
						},
						phone:{
							required:true,
							isPhone:true,
						},
						qq:{
							required:true,
							isQq : true,
						},
						password:{
							required:true,
						},
						confirmPassword:{
							required:true,
							equalTo: "#password",
						},
					},
					onkeyup:false,
					focusCleanup:true,
					success:"valid",
					submitHandler:function(form){
						$(form).ajaxSubmit({
							type: 'post',
							success: function(data){
								/* 弹出框 */
								layer.msg(data.info,{icon:1,time:3000},function()
								{
									if(data.code == '0')
									{
										var index = parent.layer.getFrameIndex(window.name);
										parent.$('.btn-success').click();
										parent.layer.close(index);
									}
								});
							},
							error: function(XmlHttpRequest, textStatus, errorThrown){
								layer.msg('error!',{icon:1,time:1000});
							},
							dataType:"json"
						});
					}
				});
				/* 初始化百度编辑器 */
				var ue = UE.getEditor('editor');
				
				/* 查询一级节点 */
				selectRegion('region1','region1','regionId','true');
			});
		</script>
	</body>
</html>